package com.dh.blog.controllers;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dh.blog.auth.AuthUtils;
import com.dh.blog.auth.annotations.Authority;
import com.dh.blog.auth.annotations.Session;
import com.ewei.web.common.response.ResponseVO;

@Controller
@RequestMapping("/test")
public class TestController {
	@RequestMapping("/session")
	@Session
	@ResponseBody
	private void session(HttpServletResponse response){
		AuthUtils.addIdentify("davidhua");
	}
	@RequestMapping("/authority")
	@Authority
	@ResponseBody
	private Object authority(){
		return new ResponseVO();
	}
	@RequestMapping(value="/b/c",method=RequestMethod.POST)
	@ResponseBody
	private Object test01(){
		System.out.println("POST");
		return new ResponseVO();
	}
	@RequestMapping(value="/b/c",method=RequestMethod.PUT)
	@ResponseBody
	private Object test02(){
		System.out.println("PUT");
		return new ResponseVO();
	}
	@RequestMapping(value="/b/c",method=RequestMethod.GET)
	@ResponseBody
	private Object test03(){
		System.out.println("GET");
		return new ResponseVO();
	}
}
